from stationpilot.servers import station_server
import openhtf as htf
from openhtf.plugs import user_input
import threading

if __name__ == "__main__":
    with station_server.StationServer(port=4482) as server:
    # def a():
        threads = []
        for i in range(2):
            test = htf.Test(
                lambda:"pass",
                lambda:"pass"
            )
            t = threading.Thread(target=test.execute,kwargs={"test_start":user_input.prompt_for_test_start()})
            t.daemon = True
            t.start()
            threads.append(t)

        for i in threads:
            try:
                i.join()
            except :
                pass
        input()
    # a()